package com.cysyz.mylib.domain;

import com.cysyz.mylib.domain.annotation.Alias;
import com.cysyz.mylib.utils.DateUtil;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.persistence.Transient;
import java.util.Date;

/**
 * Created by cuiyong on 2014/12/25.
 */
@MappedSuperclass
public abstract class CreateTimeRegisterEntity extends BaseEntity implements java.io.Serializable  {
    //columns START
    @Column(name = "CREATE_TIME", unique = false, nullable = true, length = 19)
    @Alias(cn="创建时间")
    private java.util.Date createTime = new Date();


    @Transient
    public java.util.Date getCreateTime() {
        return this.createTime;
    }


    public void setCreateTime(java.util.Date value) {
        this.createTime = value;
    }

    @Transient
    public String getCreateTimeString() {
        return DateUtil.format(getCreateTime(), DATE_TIME_FORMAT);
    }

}
